package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-06-20
 * Time: 18:46
 */
public class Test {
    public static void main(String[] args) {
        Animal animal = new Cat();
        if(animal instanceof Cat) {
            Cat cat = (Cat)animal;
        }else {
            System.out.println("不安全");
        }
    }
    public static void main1(String[] args) {
        Animal animal1 = new Cat();
        animal1.eat();
        Animal animal2 = new Bird();
        animal2.eat();
    }
}
